package cn.iocoder.an.module.business.controller.admin.equipmentcheckrecord.vo;

import cn.iocoder.an.module.business.controller.admin.equipmentcheckrecorddetail.vo.EquipmentCheckRecordDetailRespVO;
import cn.iocoder.an.module.business.dal.dataobject.equipmentcheckrecorddetail.EquipmentCheckRecordDetailDO;
import cn.iocoder.an.module.business.dal.dataobject.equipmentmanage.EquipmentManageDO;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.*;
import cn.iocoder.an.framework.excel.core.annotations.DictFormat;
import cn.iocoder.an.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 点检记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EquipmentCheckRecordRespVO implements VO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16773")
    @ExcelProperty("id")
    private Long id;


    @Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16075")
    @Trans(type = TransType.SIMPLE, target = EquipmentManageDO.class,   fields = {"equipmentModel", "deptName","code","equipmentName"},refs = {"equipmentModel", "deptName","code","equipmentName"})
    private Long equipmentId;

    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("设备名称")
    private String equipmentName;

    @Schema(description = "设备型号", requiredMode = Schema.RequiredMode.REQUIRED, example = "xxx-5")
    private String equipmentModel;

    @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "信息部")
    private String deptName;

    @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "0014")
    @ExcelProperty("设备编码")
    private String code;

    @Schema(description = "点检人")
    @ExcelProperty("点检人")
    @Trans(type = TransType.SIMPLE, targetClassName = "cn.iocoder.an.module.system.dal.dataobject.user.AdminUserDO", fields = "nickname", ref = "checkUserName")
    private Long checkUser;

    private String checkUserName;

    @Schema(description = "点检时间")
    @ExcelProperty("点检时间")
    private LocalDateTime checkTime;

    @Schema(description = "点检结果 1通过 2不通过")
    @ExcelProperty("点检结果 1通过 2不通过")
    @DictFormat("check_pass") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer checkResult;

    @Schema(description = "点检通过项ID", example = "30800")
    @ExcelProperty(value = "点检通过项ID", converter = DictConvert.class)
    private List<Long> checkItemId;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    private String remark;

    List<EquipmentCheckRecordDetailRespVO> detailDO;

}